<div class="detailsBox">
<div class="openBox">
	<div class="detaiTab">
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
           <tbody>
   					<tr>
                        <td width="15%" align="right" class="bg">配偶姓： </td>
                        <td width="35%">${customer.user_surname} </td>
                        <td width="15%" align="right" class="bg">证件类型：</td>
                        <td>
							<#if "${customer.document_type}" ==	 "IDC" > 
							个人居民身份证
							<#elseif "${customer.document_type }" ==	 "PAS"> 
							个人护照
							<#elseif "${customer.document_type }" ==	 "GPAS"> 
							个人港澳居民来往内地通行证（香港）
							<#elseif "${customer.document_type }" ==	 "APAS"> 
							个人港澳居民来往内地通行证（澳门）
							<#elseif "${customer.document_type }" ==	 "OTH"> 
							其他
							</#if>
						</td>
                    </tr>
                     <tr>
                        <td width="15%" align="right" class="bg">配偶名：</td>
                        <td width="35%">${customer.user_name}</td>
                        <td width="15%" align="right" class="bg">证件号码:</td>
                        <td id="document_no3">${customer.document_no} </td>
                    </tr>
                    <tr>
                       <td width="15%" align="right" class="bg">借款人名拼音：</td>
                       <td width="35%">${customer.customerFamilyNamePy} </td>
                       <td width="15%" align="right" class="bg">借款人姓拼音：</td>
                       <td >${customer.customerGivenNamePy} </td>
                    </tr>
                     <tr>
                     <!--
                       <td width="15%" align="right" class="bg">配偶姓名拼音：</td>
                       <td width="35%">${customer.user_name_pinyin}</td>
                       -->
                       <td width="15%" align="right" class="bg">发证机构:</td>
                       <td colspan="3">${customer.issuing_authority}</td>
                    </tr>
                    
                    <tr>
                        <td width="15%" align="right" class="bg">性别 :</td>
                        <td id="sex3"></td>
                        <td width="15%" align="right" class="bg">证件有效期:</td>
                        <td>
                        <@date name="license_expiration_date" disabled="disabled" class="bn" value="${(customer.license_expiration_date?string('yyyy-MM-dd'))!''}" />
                        </td>
                    </tr>
                    
                     <tr>
						<td width="15%" align="right" class="bg">年龄:</td>
                        <td><span id="age3"></span>（岁）</td>
                        <td width="15%" align="right" class="bg">学历:</td>
                        <td>
                        	<@select dataSouceFrom="CRM" dataSouceType="education" value="${customer.education}"  renderonly="true"/>
                        </td>
                    </tr>
                    
                    <tr>
                        <td width="15%" align="right" class="bg">联系电话 :</td>
                        <td> ${customer.user_phone}</td>
                        <td width="15%" align="right" class="bg">微信号 :</td>
                        <td>${customer.wechat}</td>
                    </tr>
                    <tr>
                        <tr>
							<td width="15%" align="right" class="bg">户籍地址 :</td>
							<td colspan="3">
								<@select dataSouceType="province" value="${customer.account_province}" renderonly="true"/>&nbsp;&nbsp;
								<@select dataSouceType="city" value="${customer.account_city}"  renderonly="true"/>&nbsp;&nbsp;
								<@select dataSouceType="COUNTY" value="${customer.account_county}"  renderonly="true"/>&nbsp;&nbsp;
	                    		${customer.permanent_residence}
							</td>
						</tr>
                        
                    </tr>
                   <tr>
                        <td width="15%" align="right" class="bg">工作单位:</td>
                        <td colspan="3">${customer.work_unit}</td>
                    </tr>
                    </tr>
			   </tbody>
          </table>
	</div> 
	</div>
</div>

 <@js>
	 var document_no = $('#document_no3').text();
	 $('#age3').text(getAge(document_no));
	 $('#sex3').text(getSex(document_no) == 'M'? '男':'女 ');
	 
	 //根据身份证信息获取年龄
	function getSex(UUserCard){
		//获取出生日期
		UUserCard.substring(6, 10) + "-" + UUserCard.substring(10, 12) + "-" + UUserCard.substring(12, 14);
		//获取性别
		if (parseInt(UUserCard.substr(16, 1)) % 2 == 1) {
			//alert("男");
		  	return 'M';
		} else {
			//alert("女");
			return 'F';
		}
	}
	
	  function getAge(UUserCard){
		var myDate = new Date();
		var month = myDate.getMonth() + 1;
		var day = myDate.getDate();
		var age = myDate.getFullYear() - UUserCard.substring(6, 10) - 1;
		if (UUserCard.substring(10, 12) < month || UUserCard.substring(10, 12) == month && UUserCard.substring(12, 14) <= day) {
			age++;
		}
		//alert(age);
		return age;
    }
	
</@js>
<@jsRender/>
